<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en" style="overflow-x: hidden">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-tap-highlight" content="no">

<link rel="stylesheet" href="<%=commonPath%>/pageRc/layui/css/layui.css"
	media="all">
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/utils.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/msgTool.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/layui/layui.js"></script>

<title>项目奖金表</title>

<script>
	$(function(){

 	})
	//注意：选项卡 依赖 element 模块，否则无法进行工能性操作
	layui.use('element', function() {
		var element = layui.element();

		//…
	});
</script>
</head>
<body class="layui-main" style="width: 100%;">
<input type="hidden" value="${positionType}" id="positionType">
		<form id="createMsgForm" name="createMsgForm" class="layui-form"
			action="">
			<div class="layui-form-item">
				<div class="layui-inline">
					<div class="layui-inline">
						申请部门：
					</div>
					<div class="layui-inline">
						<select name="proGroupNo" id="proGroupNo"
							lay-filter="proGroupSelect" style="width: 210;">
								<c:forEach items="${groupList}" var="group">
									<option value="${group.proGroupNo}">${group.proGroupName}</option>
								</c:forEach>
						</select>
					</div>
					<div class="layui-inline">
						审核状态：
					</div>
					<div class="layui-inline">
						<select name="state" id="state"
							lay-filter="stateSelect" style="width: 210;">
								<option value="">全部</option>
								<option value="">全部</option>
								<option value="00">未审核</option>
								<option value="01">通过</option>
								<option value="02">驳回</option>
						</select>
					</div>
					<div class="layui-inline">
						<button class="layui-btn" type="button" data-method="doSearchSum" id="doSearchSum" >查询</button>
					</div>
				</div>
			</div>
			<div class="layui-form-item" id="dateDiv">
				<div class="layui-inline">
					<table class="layui-table" lay-even="" lay-skin="line"
						style="text-align: center;width: 100%;">
						<colgroup align="center">
							<col width="10%">
							<col width="10%">
							<col width="10%">
							<!-- <col width="10%">-->
							<!-- <col width="10%">  -->
							<col width="10%">
						</colgroup>
						<thead>
							<tr>
								<th>团队</th>
								<th>审核状态</th>
								<!-- <th>人力部审核状态</th>
								<th>财务部审核状态</th> -->
								<th>销售总金额</th>
								<!-- <th>报工日期</th> -->
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="detailDiv">

						</tbody>
						<script id="tplSrc" type="text/html">
							 {{#  layui.each(d.body, function(index, x){}}
							     <tr align="left">
								   <td>{{x.pro_group_name==undefined?'':x.pro_group_name}}</td>
								   <td>{{x.state==undefined?'':x.state=='00'?'未审核':x.state='01'?'通过':x.state='02'?'驳回':x.state}}</td>
									<td>{{x.sum_money==undefined?'':x.sum_money}}</td>
								    <td><button  class="layui-btn" type="button" onclick="chaKan('{{x.pro_group_no}}','{{x.state}}')">查看</button></td>
								 </tr>
							{{#  }); }} 
					   </script>
					   <!-- <td> <input class="layui-input" style="width: 210" id="bgHappenDate"
							value=""
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="起始">
							<input class="layui-input" style="width: 210" id="endHappenDate"
							value=""
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="截止">
									</td> -->

					</table>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<div id="laypageDiv"></div>
				</div>
			</div><button style="margin: 0px;"></button>
		</form>
	</div>
	<input id="totalNum" type="hidden" name="totalNum" >
</body>
<script type="text/javascript">
var path="<%=commonPath%>";
	var msg = new msgTool();
	layui.use([ 'form', 'layer', 'laytpl', 'laypage', 'laydate' ],
	function() {
	var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
						var form = layui.form(), layer = layui.layer, laypage = layui.laypage, laytpl = layui.laytpl;
						var active = {
								doSearchSum : function() { //搜索
									var getTpl = tplSrc.innerHTML;
									var dataObj = {
										"pro_group_no" : $("#proGroupNo").val(),
										"state":$("#state").val()
									}
									var bgHappenDate = $("#bgHappenDate").val();
									var endHappenDate = $("#endHappenDate").val();
									if(bgHappenDate != null && endHappenDate != null && bgHappenDate != "" && endHappenDate != ""){
										if(endHappenDate<bgHappenDate){
											layer.alert("起始日期不可大于截止日期!");
										}
									}
									msg.sendMsg("/page/main/searchJiangJinShenqing.do",
										dataObj,function(data) {laytpl(getTpl).render(data,
											function(html) {
											detailDiv.innerHTML = html;
										
											});
									});
									
								}
						         
						         
													
	}
	$('.layui-btn').on('click',function() {
		var othis = $(this), method = othis.data('method');
		active[method] ? active[method].call(this,othis) : '';
	});
});
	
	 function chaKan(pro_group_no,state) {
		 if(state=='通过'){
			 state='01';
		 }
		 window.open('<%=commonPath %>/page/need/doChaKan.do?pro_group_no='+pro_group_no+'&state='+state);
         <%-- layer.open({
            type: 2,
            title:"项目奖金表",
            area: ['99%', '99%'],
            scrollbar: false,
            content: '<%=commonPath %>/page/need/doChaKan.do?pro_group_no='+pro_group_no+'&state='+state+'&bgHappenDate='+bgHappenDate+'&endHappenDate='+endHappenDate,
            success: function (layero, index) {
            },
            end: function () {
            }
        }); --%>
	 }
 
</script>

</html>